package com.music.util;

import java.text.DecimalFormat;
import java.util.Random;

public class RandomUtil {

	private static final Random random = new Random();

	private static final DecimalFormat sixdf = new DecimalFormat("000000"); // 不够六位前面用0填补

	/**
	 * 获取六位的验证码
	 * @return
	 */
	public static String getSixRandom() {
		return sixdf.format(random.nextInt(1000000));
	}

	public static void main(String[] args) {
		System.out.println(getSixRandom());
	}
}
